css: Don't throw warnings on broken URL in image css
authorBenjamin Otte <otte@redhat.com>
Tue, 26 Oct 2021 15:02:56 +0000 (17:02 +0200)
committerBenjamin Otte <otte.benjamin@googlemail.com>
Tue, 26 Oct 2021 23:44:38 +0000 (23:44 +0000)
commit36cb2e932c7d610c4e8a02e29e912a8b501f256b
tree68f032057c4660215f79a3f9069f9c1d504391b1
parent4f5264d1b7dae98e1732d57098b9a7e4940964cd
css: Don't throw warnings on broken URL in image css

If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.

This was broken since 0886ade182f1a958024202d5c20248d57fcdb053

A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.

Fixes #4373

(cherry picked from commit ac8c4245b2fb2f1fe8e660c4ad2541efb39cf3d6)
gtk/gtkcssimageurl.c
testsuite/reftests/css-image-broken-url.css [new file with mode: 0644]
testsuite/reftests/css-image-broken-url.ref.ui [new file with mode: 0644]
testsuite/reftests/css-image-broken-url.ui [new file with mode: 0644]
testsuite/reftests/meson.build